package org.john.concurrent;

import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.atomic.AtomicInteger;

/**
 * Created by adsame on 17-6-15.
 */
public class ConcurrentTest {
    public static void main(String[] args) {
        ConcurrentHashMap<Long, AtomicInteger> map =
                new ConcurrentHashMap();
        long l = 23;
        map.put(l, new AtomicInteger(1));
        AtomicInteger ai = map.get(l);
        System.out.println(ai);
        ai.getAndIncrement();
        System.out.println(map.get(l));
    }
}
